/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.casestudy1.yuh;

import com.casestudy1.main.MainMidlet;
import com.casestudy1.view.View;
import com.sun.lwuit.Command;
import com.sun.lwuit.Label;
import com.sun.lwuit.events.ActionEvent;
import com.sun.lwuit.table.TableLayout;

/**
 *
 * @author Huy
 */
public class TrafficReportDetailForm extends View {

    private Label lbl_vitri, lbl_khuvuc, lbl_mucdo, lbl_ngnhan, lbl_ttrang;
    private Label lbi_vitri, lbi_khuvuc, lbi_mucdo, lbi_ngnhan, lbi_ttrang;
    private Command cmd_back;

    public TrafficReportDetailForm(final MainMidlet midlet, trafficReport tr) {
        super(midlet);
        lbl_vitri = new Label("Vị trí : ");
        lbl_khuvuc = new Label("Khu vực : ");
        lbl_mucdo = new Label("Mức độ : ");
        lbl_ngnhan = new Label("Nguyên nhân : ");
        lbl_ttrang = new Label("Tình Trạng : ");

        lbi_vitri = new Label(tr.getVitri());
        lbi_khuvuc = new Label(tr.getKhuvuc());
        lbi_mucdo = new Label(tr.getMucdo());
        lbi_ngnhan = new Label(tr.getNgnhan());
        lbi_ttrang = new Label(tr.getTtrang());
        
        TableLayout layout = new TableLayout(5, 2);
        setLayout(layout);
        
        addComponent(lbl_vitri);
        addComponent(lbi_vitri);
        
        addComponent(lbl_khuvuc);
        addComponent(lbi_khuvuc);
        
        addComponent(lbl_mucdo);
        addComponent(lbi_mucdo);
        
        addComponent(lbl_ngnhan);
        addComponent(lbi_ngnhan);
        
        addComponent(lbl_ttrang);
        addComponent(lbi_ttrang);
        

        cmd_back = new Command("Back") {
            public void actionPerformed(ActionEvent evt) {
                new ListTrafficInfoForm(midlet,"all").show();
            }
        };
        setBackCommand(cmd_back);
        
        addCommand(cmd_back);
    }
}
